﻿<%@ Page Title="" Language="C#" MasterPageFile="~/View/MasterPage.Master" AutoEventWireup="true" CodeBehind="EditUser.aspx.cs" Inherits="GRC_TPE_WebApp.View.Private.User.EditUser" %>
<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <fieldset>
        <legend>Modifier un utilisateur : </legend>
                <table>
                    <tr>
                        <asp:ValidationSummary ID="editUserSummary" runat="server"
                        headerText="Il y a des erreurs sur la page :" />
                    </tr>
                    <tr>
                        <td>Nom : </td>
                        <td>
                            <asp:TextBox ID="editUserLastName" runat="server" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="lastnameRequired" runat="server"
                            ControlToValidate="editUserLastName"
                            ErrorMessage="Le nom est requis."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Prénom : </td>
                        <td>
                            <asp:TextBox ID="editUserFirstName" runat="server" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="firstnameRequired" runat="server"
                            ControlToValidate="editUserFirstName"
                            ErrorMessage="Le prénom est requis."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Nom d'utilisateur : </td>
                        <td>
                            <asp:TextBox ID="editUserUsername" runat="server" />

                            <%--Validator--%>
                            <asp:RequiredFieldValidator ID="usernameRequired" runat="server"
                            ControlToValidate="editUserUsername"
                            ErrorMessage="Le nom d'utilisateur est requis."> *
                            </asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td>Mot de Passe : </td>
                        <td>
                            <asp:TextBox ID="editUserPassword" runat="server" TextMode="Password" />
                            (doit être vide pour être conservé)
                            <%--Validator--%>
                            <%--<asp:RequiredFieldValidator ID="passwordRequired" runat="server"
                            ControlToValidate="editUserPassword"
                            ErrorMessage="Le mot de passe est requis."> *
                            </asp:RequiredFieldValidator>--%>
                        </td>
                    </tr>
                    <tr>
                        <td>Confirmer le Mot de Passe : </td>
                        <td>
                            <asp:TextBox ID="editUserConfirmPassword" runat="server" TextMode="Password" />
                            
                            <%--Validator--%>
                            <%--<asp:RequiredFieldValidator ID="confirmPasswordRequired" runat="server"
                            ControlToValidate="editUserConfirmPassword"
                            ErrorMessage="La confirmation du mot de passe est requise."> *
                            </asp:RequiredFieldValidator>--%>

                            <%--Validator : Compare les mots de passe--%>
                            <asp:CompareValidator ID="CompareValidator1" runat="server"
                            ControlToValidate="editUserPassword"
                            ControlToCompare="editUserConfirmPassword"
                            ErrorMessage="Les mots de passe sont différents." />
                        </td>
                    </tr>
                    <tr>
                        <td>Type : </td>
                        <td>
                            <asp:DropDownList ID="editUserType" runat="server" Enabled="false">
                                <asp:ListItem>Utilisateur</asp:ListItem>
                                <asp:ListItem>Administrateur</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Button ID="B_SaveUser" runat="server" Text="Enregistrer" OnClick="B_SaveUser_Click"/></td>
                        <td><asp:Button ID="B_Cancel" runat="server" Text="Annuler" OnClick="B_Cancel_Click" CausesValidation="false"/></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="editUserErrorMessage"  runat="server" />
                        </td>
                    </tr>
                </table>
    </fieldset>

</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="footer" runat="server">
</asp:Content>